import QtQuick 1.0

Rectangle {
    id: thumbnail

    property string source

    signal clicked()

    radius: width == 0 ? 0 : 5
    border.color: "#808080"
    border.width: width == 0 ? 0 : 3
    color: mouseArea.pressed ? "black" : "white"

    Image {
        source: thumbnail.source
        anchors.centerIn: parent

        MouseArea {
            id: mouseArea
            anchors.fill: parent
            onClicked: {
                thumbnail.clicked()
            }
        }
    }
}
